package lagern;

/**
 * Interface definition: Lager.
 * 
 * @author OpenORB Compiler
 */
public class _LagerStub extends org.omg.CORBA.portable.ObjectImpl
        implements Lager
{
    static final String[] _ids_list =
    {
        "IDL:lagern/Lager:1.0"
    };

    public String[] _ids()
    {
     return _ids_list;
    }

    private final static Class _opsClass = lagern.LagerOperations.class;

    /**
     * Operation neu
     */
    public lagern.Fach neu(String user, String name)
        throws lagern.LagerPackage.exAlreadyExists
    {
        while(true)
        {
            if (!this._is_local())
            {
                org.omg.CORBA.portable.InputStream _input = null;
                try
                {
                    org.omg.CORBA.portable.OutputStream _output = this._request("neu",true);
                    _output.write_string(user);
                    _output.write_string(name);
                    _input = this._invoke(_output);
                    lagern.Fach _arg_ret = lagern.FachHelper.read(_input);
                    return _arg_ret;
                }
                catch(org.omg.CORBA.portable.RemarshalException _exception)
                {
                    continue;
                }
                catch(org.omg.CORBA.portable.ApplicationException _exception)
                {
                    String _exception_id = _exception.getId();
                    if (_exception_id.equals(lagern.LagerPackage.exAlreadyExistsHelper.id()))
                    {
                        throw lagern.LagerPackage.exAlreadyExistsHelper.read(_exception.getInputStream());
                    }

                    throw new org.omg.CORBA.UNKNOWN("Unexpected User Exception: "+ _exception_id);
                }
                finally
                {
                    this._releaseReply(_input);
                }
            }
            else
            {
                org.omg.CORBA.portable.ServantObject _so = _servant_preinvoke("neu",_opsClass);
                if (_so == null)
                   continue;
                lagern.LagerOperations _self = (lagern.LagerOperations) _so.servant;
                try
                {
                    return _self.neu( user,  name);
                }
                finally
                {
                    _servant_postinvoke(_so);
                }
            }
        }
    }

    /**
     * Operation hole
     */
    public lagern.Fach hole(String user, String name)
        throws lagern.LagerPackage.exNotFound
    {
        while(true)
        {
            if (!this._is_local())
            {
                org.omg.CORBA.portable.InputStream _input = null;
                try
                {
                    org.omg.CORBA.portable.OutputStream _output = this._request("hole",true);
                    _output.write_string(user);
                    _output.write_string(name);
                    _input = this._invoke(_output);
                    lagern.Fach _arg_ret = lagern.FachHelper.read(_input);
                    return _arg_ret;
                }
                catch(org.omg.CORBA.portable.RemarshalException _exception)
                {
                    continue;
                }
                catch(org.omg.CORBA.portable.ApplicationException _exception)
                {
                    String _exception_id = _exception.getId();
                    if (_exception_id.equals(lagern.LagerPackage.exNotFoundHelper.id()))
                    {
                        throw lagern.LagerPackage.exNotFoundHelper.read(_exception.getInputStream());
                    }

                    throw new org.omg.CORBA.UNKNOWN("Unexpected User Exception: "+ _exception_id);
                }
                finally
                {
                    this._releaseReply(_input);
                }
            }
            else
            {
                org.omg.CORBA.portable.ServantObject _so = _servant_preinvoke("hole",_opsClass);
                if (_so == null)
                   continue;
                lagern.LagerOperations _self = (lagern.LagerOperations) _so.servant;
                try
                {
                    return _self.hole( user,  name);
                }
                finally
                {
                    _servant_postinvoke(_so);
                }
            }
        }
    }

    /**
     * Operation holeLagerListe
     */
    public lagern.Fach[] holeLagerListe()
    {
        while(true)
        {
            if (!this._is_local())
            {
                org.omg.CORBA.portable.InputStream _input = null;
                try
                {
                    org.omg.CORBA.portable.OutputStream _output = this._request("holeLagerListe",true);
                    _input = this._invoke(_output);
                    lagern.Fach[] _arg_ret = lagern.FachListeHelper.read(_input);
                    return _arg_ret;
                }
                catch(org.omg.CORBA.portable.RemarshalException _exception)
                {
                    continue;
                }
                catch(org.omg.CORBA.portable.ApplicationException _exception)
                {
                    String _exception_id = _exception.getId();
                    throw new org.omg.CORBA.UNKNOWN("Unexpected User Exception: "+ _exception_id);
                }
                finally
                {
                    this._releaseReply(_input);
                }
            }
            else
            {
                org.omg.CORBA.portable.ServantObject _so = _servant_preinvoke("holeLagerListe",_opsClass);
                if (_so == null)
                   continue;
                lagern.LagerOperations _self = (lagern.LagerOperations) _so.servant;
                try
                {
                    return _self.holeLagerListe();
                }
                finally
                {
                    _servant_postinvoke(_so);
                }
            }
        }
    }

    /**
     * Operation aktiviereMonitor
     */
    public void aktiviereMonitor(lagern.Monitor theMonitor)
    {
        while(true)
        {
            if (!this._is_local())
            {
                org.omg.CORBA.portable.InputStream _input = null;
                try
                {
                    org.omg.CORBA.portable.OutputStream _output = this._request("aktiviereMonitor",true);
                    lagern.MonitorHelper.write(_output,theMonitor);
                    _input = this._invoke(_output);
                    return;
                }
                catch(org.omg.CORBA.portable.RemarshalException _exception)
                {
                    continue;
                }
                catch(org.omg.CORBA.portable.ApplicationException _exception)
                {
                    String _exception_id = _exception.getId();
                    throw new org.omg.CORBA.UNKNOWN("Unexpected User Exception: "+ _exception_id);
                }
                finally
                {
                    this._releaseReply(_input);
                }
            }
            else
            {
                org.omg.CORBA.portable.ServantObject _so = _servant_preinvoke("aktiviereMonitor",_opsClass);
                if (_so == null)
                   continue;
                lagern.LagerOperations _self = (lagern.LagerOperations) _so.servant;
                try
                {
                    _self.aktiviereMonitor( theMonitor);
                    return;
                }
                finally
                {
                    _servant_postinvoke(_so);
                }
            }
        }
    }

    /**
     * Operation entferneMonitor
     */
    public void entferneMonitor(lagern.Monitor theMonitor)
    {
        while(true)
        {
            if (!this._is_local())
            {
                org.omg.CORBA.portable.InputStream _input = null;
                try
                {
                    org.omg.CORBA.portable.OutputStream _output = this._request("entferneMonitor",true);
                    lagern.MonitorHelper.write(_output,theMonitor);
                    _input = this._invoke(_output);
                    return;
                }
                catch(org.omg.CORBA.portable.RemarshalException _exception)
                {
                    continue;
                }
                catch(org.omg.CORBA.portable.ApplicationException _exception)
                {
                    String _exception_id = _exception.getId();
                    throw new org.omg.CORBA.UNKNOWN("Unexpected User Exception: "+ _exception_id);
                }
                finally
                {
                    this._releaseReply(_input);
                }
            }
            else
            {
                org.omg.CORBA.portable.ServantObject _so = _servant_preinvoke("entferneMonitor",_opsClass);
                if (_so == null)
                   continue;
                lagern.LagerOperations _self = (lagern.LagerOperations) _so.servant;
                try
                {
                    _self.entferneMonitor( theMonitor);
                    return;
                }
                finally
                {
                    _servant_postinvoke(_so);
                }
            }
        }
    }

    /**
     * Operation quit
     */
    public void quit()
    {
        while(true)
        {
            if (!this._is_local())
            {
                org.omg.CORBA.portable.InputStream _input = null;
                try
                {
                    org.omg.CORBA.portable.OutputStream _output = this._request("quit",true);
                    _input = this._invoke(_output);
                    return;
                }
                catch(org.omg.CORBA.portable.RemarshalException _exception)
                {
                    continue;
                }
                catch(org.omg.CORBA.portable.ApplicationException _exception)
                {
                    String _exception_id = _exception.getId();
                    throw new org.omg.CORBA.UNKNOWN("Unexpected User Exception: "+ _exception_id);
                }
                finally
                {
                    this._releaseReply(_input);
                }
            }
            else
            {
                org.omg.CORBA.portable.ServantObject _so = _servant_preinvoke("quit",_opsClass);
                if (_so == null)
                   continue;
                lagern.LagerOperations _self = (lagern.LagerOperations) _so.servant;
                try
                {
                    _self.quit();
                    return;
                }
                finally
                {
                    _servant_postinvoke(_so);
                }
            }
        }
    }

}
